package com.leyou.Mapper;


import item.pojo.Category;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.additional.idlist.SelectByIdListMapper;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;


public interface CategoryMapper extends Mapper<Category>,SelectByIdListMapper<Category, Long> {
//    根据id查询对应的分类id
    @Select("SELECT * FROM tb_category WHERE id IN " +
            "(SELECT category_id FROM tb_category_brand WHERE brand_id = #{bid})")
    List<Category> queryByBrandId(Long bid);

}
